package day04;
// Switch - cose // 结构的演示
public class SwitchCaseDemo {
    public static void main(String[] args) {
        int num = 2;
        switch(num){
            case 1: // 相当于 if (num = 1)
                System.out.println(111);
                break; // 跳出 switch
            case 2: // 以此为入口
                System.out.println(222);
                break;
            case 3:
                System.out.println(333);
                break;
            default: // 当所有 case 都未匹配时执行
                System.out.println(444);
        }


        int a = 2;
        switch (a){
            case 1:
                System.out.println(1);
                break;
            case 2:
                System.out.println(2);
                break;
            case 3:
                System.out.println(3);
                break;
            default:
                System.out.println(4);
        }
    }
}
